import {deleteRequest, getRequest, postRequest, putRequest} from '../baseRequest'

// 查询系统通告列表
export const listAnnouncement = (params) => getRequest('/sys/announce/page', params)

// 查询系统通告详细
export const getAnnouncement = (id) => getRequest('/sys/announce/' + id)

// 新增系统通告
export const addAnnouncement = (data) => postRequest('/sys/announce', data)


// 修改系统通告
export const updateAnnouncement = (data) => putRequest('/sys/announce', data)


// 删除系统通告
export const delAnnouncement = (id) => deleteRequest('/sys/announce/' + id)


// 发布系统公告
export const releaseAnnouncement = (id) => postRequest(`/sys/announce/release/${id}`)

// 发布系统公告
export const revokeAnnouncement = (id) => postRequest(`/sys/announce/revoke/${id}`)

/**
 * 查询我的消息列表
 * @param params
 */
export const getMyAnnouncementSend = (params) => getRequest('/sys/announce/getMyAnnouncementSend', params)

/**
 * 首页通知列表
 * @param params
 */
export const getMyUnReadAnnouncementSend = (params) => getRequest('/sys/announce/unread/list', params)

/**
 * 首页通知列表
 * @param params
 */
export const getMyAnnouncementNotice = (params) => getRequest('/sys/announce/notice', params)

/**
 * 标记消息已读
 */
export const readAnnouncementSend = (id) => putRequest('/sys/announce/read/' + id)
/**
 * 标记全部已读
 */
export const readAllAnnouncementSend = (data) => putRequest('/sys/announce/readAll/', data)
